/*
 * @Descripttion: 后台管理系统
 * @version: 1.0
 * @Author: 狸猫
 * @Date: 2023-11-27 15:56:18
 * @LastEditors: 赛罗
 * @LastEditTime: 2024-05-21 17:28:56
 */
import request from '@/utils/request'


// 统计订单各个状态的数量
export function countOrderState(query) {
  return request({
    url: '/enterprise/order/order/countOrderState',
    method: 'get',
    params: query
  })
}
// 查询订单列表
export function listOrder(query) {
  return request({
    url: '/enterprise/order/order/list',
    method: 'get',
    params: query,
  })
}

// 查询有效订单列表
export function validList(query) {
  return request({
    url: '/enterprise/order/order/validList',
    method: 'get',
    params: query,
  })
}

// 查询订单操作记录
export function orderRecordList(query) {
  return request({
    url: '/enterprise/order/orderRecord/list',
    method: 'get',
    params: query,
  })
}




// 订单换房
export function changeHouse(data) {
  return request({
    url: '/enterprise/order/order/changeHouse',
    method: 'post',
    data: data
  })
}

// 修改预定时间
export function updateReservationInfo(data) {
  return request({
    url: '/enterprise/order/order/updateReservationInfo',
    method: 'post',
    data: data
  })
}

// 查询房间详情
export function getOrder(orderId) {
  return request({
    url: '/enterprise/order/order/' + orderId,
    method: 'get'
  })
}

// 新建订单
export function addOrder(data) {
  return request({
    url: '/enterprise/order/order',
    method: 'post',
    data: data
  })
}

// 预定变更订单
export function changeOrder(data) {
  return request({
    url: '/enterprise/order/order/changeOrder',
    method: 'post',
    data: data
  })
}

// 作废订单
export function cancelOrder(orderId) {
  return request({
    url: '/enterprise/order/order/cancel/'+ orderId,
    method: 'get',
  })
}
// 获取订单详情
export function getOrderInfo(orderId) {
  return request({
    url: '/enterprise/order/order/' + orderId,
    method: 'get'
  })
}

// 查询验房退租信息
export function getInspectionfoByOrderId(orderId) {
  return request({
    url: '/enterprise/order/houseInspection/getInfoByOrderId/' + orderId,
    method: 'get'
  })
}

// 签约
export function orderSign(data) {
  return request({
    url: '/enterprise/order/order/sign',
    method: 'post',
    data: data
  })
}

// 查询审核设置
export function orderAuditing() {
  return request({
    url: '/enterprise/order/orderAuditing',
    method: 'get',
  })
}

// 修改审核设置
export function putOrderAuditing(data) {
  return request({
    url: '/enterprise/order/orderAuditing',
    method: 'put',
    data:data
  })
}

// 查询订单审核记录
export function auditRecord(query) {
  return request({
    url: '/enterprise/order/auditRecord/list',
    method: 'get',
    params:query
    //auditRecordType 审核记录类型：1签约 2退租 3换房 4转租 5续租
  })
}

// 查询订单审核详情
export function getauditRecord(id) {
  return request({
    url: '/enterprise/order/auditRecord/' + id,
    method: 'get'
  })
}

// 审核订单
export function checkAuditRecord(data) {
  return request({
    url: '/enterprise/order/auditRecord',
    method: 'put',
    data:data
  })
}

// 退租
export function refundRent(data) {
  return request({
    url: '/enterprise/order/order/refundRent',
    method: 'post',
    data:data
  })
}

// 换房
export function exchangeHouse(data) {
  return request({
    url: '/enterprise/order/order/exchangeHouse',
    method: 'post',
    data: data
  })
}

// 续租
export function relet(data) {
  return request({
    url: '/enterprise/order/order/relet',
    method: 'post',
    data: data
  })
}
// 转租
export function sublease(data) {
  return request({
    url: '/enterprise/order/order/sublease',
    method: 'post',
    data: data
  })
}
// 订单修改备注
export function orderRemark(data) {
  return request({
    url: '/enterprise/order/order',
    method: 'put',
    data: data
  })
}
// 验房
export function orderInspection(data) {
  return request({
    url: '/enterprise/order/houseInspection/orderInspection',
    method: 'post',
    data: data
  })
}

// 新增入住信息
export function addOrderLessee(data) {
  return request({
    url: '/enterprise/order/orderLessee/addOrderLessee',
    method: 'post',
    data: data
  })
}

// 续租
export function orderRelet(data) {
  return request({
    url: '/enterprise/order/order/relet',
    method: 'post',
    data: data
  })
}





